
CREATE TABLE [dbo].[Storage](
	[StorageID] [int] IDENTITY(400000,1) NOT NULL,
	[ServerSQLID] [int] NOT NULL,
	[DeviceID] [char](2) NOT NULL,
	[VolumeName] [nvarchar](128) NULL,
	[TotalSize] [decimal](19, 2) NULL,
	[FreeSize] [decimal](19, 2) NULL,
	[FreePercent] [decimal](5, 2) NULL,
	[CreateDate] [smalldatetime] NOT NULL,
	[UpdateDate] [smalldatetime] NOT NULL,
	[Active] [tinyint] NOT NULL,
 CONSTRAINT [PK_Storage] PRIMARY KEY CLUSTERED 
(
	[StorageID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The name assigned to the drive on the system.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Storage', @level2type=N'COLUMN',@level2name=N'VolumeName'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Size of the disk drive in gigabytes.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Storage', @level2type=N'COLUMN',@level2name=N'TotalSize'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Disk drive available space in gigabytes.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Storage', @level2type=N'COLUMN',@level2name=N'FreeSize'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Disk drive available space in percent.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Storage', @level2type=N'COLUMN',@level2name=N'FreePercent'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The Storage table contains data file information for all databases in the inventory system.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Storage'
GO

ALTER TABLE [dbo].[Storage] ADD  CONSTRAINT [DF_Storage_Active]  DEFAULT ((0)) FOR [Active]
GO

